package learn.actuator;

import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.annotation.WriteOperation;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.Map;

/**
 * @Description:
 * @Author yxc
 * @Date 2022/1/12
 */

@Component
@Endpoint(id = "myCustomEndPoint")
public class MyCustomEndPoint {
    @ReadOperation
    public Map getDockerInfo() {
        return Collections.singletonMap("info", "docker started...");
    }

    @WriteOperation
    private void restartDocker() {
        System.out.println("docker restarted..33..");
    }

}
